 

<!DOCTYPE html>
<html>

<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=0.7, user-scalable=no, shrink-to-fit=no">
 <script src="jquery.min.js"></script>
</head>


<div>
<a href="#" onclick="gotologin()">登录</a>
</div>


<div>

<a href="#" onclick="gotoguess()">投注</a>
</div>


<script>
var uid = 0;
var token = '';
function gotologin(){
  $.ajax({
                            type: "POST",
                            
							 url: "http://localhost:8081/user/login",
                            contentType: "application/json; charset=utf-8",
                            data: JSON.stringify({"username":"13061515230","pass":"123456"}),
							  dataType:"json",
                            success: function (resp) {
                                console.log(resp);
								if(resp.code == 0){
								console.log(resp.msg);
									var msg = JSON.parse(resp.msg);
									uid = msg.id;
									token = msg.token;
									 console.log(msg);
									
								}
                            },
                            error: function (err) {
                                 console.log(err);
                            }
                        })


}
function gotoguess(){
  $.ajax({
                            type: "POST",
                            
							 url: "http://localhost:8081/order/record",
                            contentType: "application/json; charset=utf-8",
                            data: JSON.stringify({"token": token  ,"type":"1","score":100,"minute":20}),
							 
                            success: function (resp) {
                                console.log(resp);
								if(resp.code == 0){
									 
									
								}
                            },
                            error: function (err) {
                                 console.log(err);
                            }
                        })


}


</script>




















